<div class="form">

    <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'foto-form',
            'enableAjaxValidation'=>false,
            'htmlOptions'=>array('enctype'=>'multipart/form-data'),
    )); ?>


    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model,'Категория'); ?>
        <?php echo $form->dropDownList($model,'id_foto_cat',$model->getAllCat());  ?>
        <?php echo $form->error($model,'id_foto_cat'); ?>
    </div>
    <?php if($model->isNewRecord) {?>
    <div class="row">
            <?php echo CHtml::activeFileField($model, 'file_name'); ?>
    </div>
        <?php }?>

    <div class="row">
        <?php echo $form->labelEx($model,'Название'); ?>
        <?php echo $form->textField($model,'name',array('rows'=>2, 'cols'=>100)); ?>
        <?php echo $form->error($model,'name'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'Описание'); ?>
        <?php echo $form->textArea($model,'description',array('rows'=>5, 'cols'=>100)); ?>
        <?php echo $form->error($model,'description'); ?>
    </div>



    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Добавить' : 'Сохранить'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->